import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'
import 'normalize.css'
import './assets/main.css'
import clickOutside from '@/utils/clickOutside'

// import * as echarts from 'echarts/core'
// import { BarChart, LineChart } from 'echarts/charts'
// import { GridComponent, TooltipComponent, LegendComponent } from 'echarts/components'
// import { CanvasRenderer } from 'echarts/renderers'
// echarts.use([BarChart, LineChart, GridComponent, TooltipComponent, LegendComponent, CanvasRenderer])
const app = createApp(App)

app.use(createPinia())
app.directive('click-outside', clickOutside)
app.use(router)
const rootValue = 16
const rootWidth = 1920 //设计稿的宽度
const deviceWidth = document.documentElement.clientWidth
document.documentElement.style.fontSize = (deviceWidth * rootValue) / rootWidth + 'px'
// 全局注册ECharts
// app.config.globalProperties.$echarts = echarts
app.mount('#app')
